import java.util.Scanner;
enum estimate{
    YES,NO;
}
public class text {
    public static void main(String[] args) {
        int c=1;
        while (c==1){
            Scanner a = new Scanner(System.in);
            System.out.println("请输入半径");
            double r=a.nextDouble();
            System.out.println("请输入长");
            double l=a.nextDouble();
            System.out.println("请输入宽");
            double w = a.nextDouble();
            areaCompare(r,l,w);
            perimeterCompare(r,l,w);
            System.out.println("输入1继续判断，非1数字则终止程序");
            int x=a.nextInt();
            estimate zx;
            if(x==1){
                zx= estimate.YES;
            }else {
                zx= estimate.NO;
            }

            switch (zx){
                case YES:
                    continue;
                case NO:
                    c=c+1;
                    break;
            }
        }
    }
     public static void areaCompare(double r,double l,double w){
        Circle circle = new Circle();
        Rectangle rectangle = new Rectangle();
        circle.setRadius(r);
        rectangle.setLength(l);
        rectangle.setWidth(w);
        if(circle.area()>rectangle.area()){
            System.out.println("圆大");
        }else if(circle.area()<rectangle.area()){
            System.out.println("方大");
        }else{
            System.out.println("一样大");
        }
    }
    public static void perimeterCompare(double r,double l,double w){
        Circle circle = new Circle();
        Rectangle rectangle = new Rectangle();
        circle.setRadius(r);
        rectangle.setLength(l);
        rectangle.setWidth(w);
        if(circle.perimeter()>rectangle.perimeter()){
            System.out.println("圆的周长长");
        }else if(circle.perimeter()<rectangle.perimeter()){
            System.out.println("方的周长长");
        }else{
            System.out.println("一样长");
        }
    }
}
